3.175 \(\int (g \cos (e+f x))^{5-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx\)

Optimal. Leaf size=203 \[ -\frac{8 a^3 (a \sin (e+f x)+a)^{m-3} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+3) (-m+n+4) (-m+n+5)}-\frac{4 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+4) (-m+n+5)}-\frac{a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+5)} \]

[Out]

(-8*a^3*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-3 + m)*(c - c*Sin[e + f*x])^n)/(f*g*(3 - m + n)*(4 -
 m + n)*(5 - m + n)) - (4*a^2*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-2 + m)*(c - c*Sin[e + f*x])^n)
/(f*g*(4 - m + n)*(5 - m + n)) - (a*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-1 + m)*(c - c*Sin[e + f*
x])^n)/(f*g*(5 - m + n))

________________________________________________________________________________________

Rubi [A]  time = 0.678372, antiderivative size = 203, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.05, Rules used = {2846, 2844} \[ -\frac{8 a^3 (a \sin (e+f x)+a)^{m-3} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+3) (-m+n+4) (-m+n+5)}-\frac{4 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+4) (-m+n+5)}-\frac{a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{6-2 m}}{f g (-m+n+5)} \]

Antiderivative was successfully verified.

[In]

Int[(g*Cos[e + f*x])^(5 - 2*m)*(a + a*Sin[e + f*x])^m*(c - c*Sin[e + f*x])^n,x]

[Out]

(-8*a^3*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-3 + m)*(c - c*Sin[e + f*x])^n)/(f*g*(3 - m + n)*(4 -
 m + n)*(5 - m + n)) - (4*a^2*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-2 + m)*(c - c*Sin[e + f*x])^n)
/(f*g*(4 - m + n)*(5 - m + n)) - (a*(g*Cos[e + f*x])^(6 - 2*m)*(a + a*Sin[e + f*x])^(-1 + m)*(c - c*Sin[e + f*
x])^n)/(f*g*(5 - m + n))

Rule 2846

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) +
 (f_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e +
 f*x])^n)/(f*g*(m + n + p)), x] + Dist[(a*(2*m + p - 1))/(m + n + p), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*
x])^(m - 1)*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && Eq
Q[a^2 - b^2, 0] && IGtQ[Simplify[m + p/2 - 1/2], 0] &&  !LtQ[n, -1] &&  !(IGtQ[Simplify[n + p/2 - 1/2], 0] &&
GtQ[m - n, 0]) &&  !(ILtQ[Simplify[m + n + p], 0] && GtQ[Simplify[2*m + n + (3*p)/2 + 1], 0])

Rule 2844

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) +
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e +
f*x])^n)/(f*g*(m - n - 1)), x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b
^2, 0] && EqQ[2*m + p - 1, 0] && NeQ[m - n - 1, 0]

Rubi steps

\begin{align*} \int (g \cos (e+f x))^{5-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx &=-\frac{a (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (5-m+n)}+\frac{(4 a) \int (g \cos (e+f x))^{5-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n \, dx}{5-m+n}\\ &=-\frac{4 a^2 (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n}{f g (4-m+n) (5-m+n)}-\frac{a (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (5-m+n)}+\frac{\left (8 a^2\right ) \int (g \cos (e+f x))^{5-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n \, dx}{(4-m+n) (5-m+n)}\\ &=-\frac{8 a^3 (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-3+m} (c-c \sin (e+f x))^n}{f g (3-m+n) (4-m+n) (5-m+n)}-\frac{4 a^2 (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n}{f g (4-m+n) (5-m+n)}-\frac{a (g \cos (e+f x))^{6-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (5-m+n)}\\ \end{align*}

Mathematica [A]  time = 6.65832, size = 210, normalized size = 1.03 \[ \frac{g^5 \cos ^{2 n}(e+f x) \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )^6 (g \cos (e+f x))^{-2 m} (a (\sin (e+f x)+1))^{m-n} \left (-4 \left (m^2-2 m n-9 m+n^2+9 n+18\right ) \sin (e+f x)+\left (m^2-m (2 n+7)+n^2+7 n+12\right ) \cos (2 (e+f x))-3 m^2+6 m n+29 m-3 n^2-29 n-76\right ) \exp (n (\log (a (\sin (e+f x)+1))+\log (c-c \sin (e+f x))-2 \log (\cos (e+f x))))}{2 f (-m+n+3) (-m+n+4) (-m+n+5)} \]

Antiderivative was successfully verified.

[In]

Integrate[(g*Cos[e + f*x])^(5 - 2*m)*(a + a*Sin[e + f*x])^m*(c - c*Sin[e + f*x])^n,x]

[Out]

(E^(n*(-2*Log[Cos[e + f*x]] + Log[a*(1 + Sin[e + f*x])] + Log[c - c*Sin[e + f*x]]))*g^5*Cos[e + f*x]^(2*n)*(Co
s[(e + f*x)/2] - Sin[(e + f*x)/2])^6*(a*(1 + Sin[e + f*x]))^(m - n)*(-76 + 29*m - 3*m^2 - 29*n + 6*m*n - 3*n^2
 + (12 + m^2 + 7*n + n^2 - m*(7 + 2*n))*Cos[2*(e + f*x)] - 4*(18 - 9*m + m^2 + 9*n - 2*m*n + n^2)*Sin[e + f*x]
))/(2*f*(3 - m + n)*(4 - m + n)*(5 - m + n)*(g*Cos[e + f*x])^(2*m))

________________________________________________________________________________________

Maple [F]  time = 11.848, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{5-2\,m} \left ( a+a\sin \left ( fx+e \right ) \right ) ^{m} \left ( c-c\sin \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*cos(f*x+e))^(5-2*m)*(a+a*sin(f*x+e))^m*(c-c*sin(f*x+e))^n,x)

[Out]

int((g*cos(f*x+e))^(5-2*m)*(a+a*sin(f*x+e))^m*(c-c*sin(f*x+e))^n,x)

________________________________________________________________________________________

Maxima [B]  time = 2.98214, size = 1320, normalized size = 6.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^(5-2*m)*(a+a*sin(f*x+e))^m*(c-c*sin(f*x+e))^n,x, algorithm="maxima")

[Out]

((m^2 - m*(2*n + 11) + n^2 + 11*n + 32)*a^m*c^n*g^5 - 2*(m^2 - m*(2*n + 15) + n^2 + 15*n + 60)*a^m*c^n*g^5*sin
(f*x + e)/(cos(f*x + e) + 1) - (3*m^2 - m*(6*n + 1) + 3*n^2 + n - 160)*a^m*c^n*g^5*sin(f*x + e)^2/(cos(f*x + e
) + 1)^2 + 8*(m^2 - m*(2*n + 7) + n^2 + 7*n - 20)*a^m*c^n*g^5*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 2*(m^2 - m
*(2*n - 5) + n^2 - 5*n + 160)*a^m*c^n*g^5*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 - 4*(3*m^2 - m*(6*n + 13) + 3*n^
2 + 13*n + 116)*a^m*c^n*g^5*sin(f*x + e)^5/(cos(f*x + e) + 1)^5 + 2*(m^2 - m*(2*n - 5) + n^2 - 5*n + 160)*a^m*
c^n*g^5*sin(f*x + e)^6/(cos(f*x + e) + 1)^6 + 8*(m^2 - m*(2*n + 7) + n^2 + 7*n - 20)*a^m*c^n*g^5*sin(f*x + e)^
7/(cos(f*x + e) + 1)^7 - (3*m^2 - m*(6*n + 1) + 3*n^2 + n - 160)*a^m*c^n*g^5*sin(f*x + e)^8/(cos(f*x + e) + 1)
^8 - 2*(m^2 - m*(2*n + 15) + n^2 + 15*n + 60)*a^m*c^n*g^5*sin(f*x + e)^9/(cos(f*x + e) + 1)^9 + (m^2 - m*(2*n
+ 11) + n^2 + 11*n + 32)*a^m*c^n*g^5*sin(f*x + e)^10/(cos(f*x + e) + 1)^10)*e^(2*n*log(sin(f*x + e)/(cos(f*x +
 e) + 1) - 1) - 2*m*log(-sin(f*x + e)/(cos(f*x + e) + 1) + 1) + m*log(sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 1)
 - n*log(sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 1))/(((m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 + 24*n + 47)*m - 12*n
^2 - 47*n - 60)*g^(2*m) + 5*(m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 + 24*n + 47)*m - 12*n^2 - 47*n - 60)*g^(2*m)*s
in(f*x + e)^2/(cos(f*x + e) + 1)^2 + 10*(m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 + 24*n + 47)*m - 12*n^2 - 47*n - 6
0)*g^(2*m)*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 10*(m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 + 24*n + 47)*m - 12*n^
2 - 47*n - 60)*g^(2*m)*sin(f*x + e)^6/(cos(f*x + e) + 1)^6 + 5*(m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 + 24*n + 47
)*m - 12*n^2 - 47*n - 60)*g^(2*m)*sin(f*x + e)^8/(cos(f*x + e) + 1)^8 + (m^3 - 3*m^2*(n + 4) - n^3 + (3*n^2 +
24*n + 47)*m - 12*n^2 - 47*n - 60)*g^(2*m)*sin(f*x + e)^10/(cos(f*x + e) + 1)^10)*f)

________________________________________________________________________________________

Fricas [B]  time = 2.01563, size = 1609, normalized size = 7.93 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^(5-2*m)*(a+a*sin(f*x+e))^m*(c-c*sin(f*x+e))^n,x, algorithm="fricas")

[Out]

-((m^2 - (2*m - 7)*n + n^2 - 7*m + 12)*cos(f*x + e)^3 - (m^2 - (2*m - 11)*n + n^2 - 11*m + 24)*cos(f*x + e)^2
- 2*(m^2 - (2*m - 9)*n + n^2 - 9*m + 22)*cos(f*x + e) - ((m^2 - (2*m - 7)*n + n^2 - 7*m + 12)*cos(f*x + e)^2 +
 2*(m^2 - (2*m - 9)*n + n^2 - 9*m + 18)*cos(f*x + e) - 8)*sin(f*x + e) - 8)*(g*cos(f*x + e))^(-2*m + 5)*(a*sin
(f*x + e) + a)^m*e^(2*n*log(g*cos(f*x + e)) - n*log(a*sin(f*x + e) + a) + n*log(a*c/g^2))/(4*f*m^3 - 4*f*n^3 -
 (f*m^3 - f*n^3 - 12*f*m^2 + 3*(f*m - 4*f)*n^2 + 47*f*m - (3*f*m^2 - 24*f*m + 47*f)*n - 60*f)*cos(f*x + e)^3 -
 48*f*m^2 + 12*(f*m - 4*f)*n^2 - 3*(f*m^3 - f*n^3 - 12*f*m^2 + 3*(f*m - 4*f)*n^2 + 47*f*m - (3*f*m^2 - 24*f*m
+ 47*f)*n - 60*f)*cos(f*x + e)^2 + 188*f*m - 4*(3*f*m^2 - 24*f*m + 47*f)*n + 2*(f*m^3 - f*n^3 - 12*f*m^2 + 3*(
f*m - 4*f)*n^2 + 47*f*m - (3*f*m^2 - 24*f*m + 47*f)*n - 60*f)*cos(f*x + e) + (4*f*m^3 - 4*f*n^3 - 48*f*m^2 + 1
2*(f*m - 4*f)*n^2 - (f*m^3 - f*n^3 - 12*f*m^2 + 3*(f*m - 4*f)*n^2 + 47*f*m - (3*f*m^2 - 24*f*m + 47*f)*n - 60*
f)*cos(f*x + e)^2 + 188*f*m - 4*(3*f*m^2 - 24*f*m + 47*f)*n + 2*(f*m^3 - f*n^3 - 12*f*m^2 + 3*(f*m - 4*f)*n^2
+ 47*f*m - (3*f*m^2 - 24*f*m + 47*f)*n - 60*f)*cos(f*x + e) - 240*f)*sin(f*x + e) - 240*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))**(5-2*m)*(a+a*sin(f*x+e))**m*(c-c*sin(f*x+e))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^(5-2*m)*(a+a*sin(f*x+e))^m*(c-c*sin(f*x+e))^n,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError